package com.nebula.core.dsl.builder;

import java.util.List;

/**
 * @author zhangtao
 */
public interface FindPathStatementBuilder extends StatementBuilder {

    interface FindPathStatement extends FindPathStart, FindPathTypeOut, FindPathWithPropOut, FindPathFromToOut,
            FindPathStepOut, FindPathYieldOut, FindPathWhereOut, FindPathOverOut, FindPathLimitOut {

    }

    interface FindPathStart extends FindPathType {

    }

    interface FindPathType {
        /**
         * 全路径
         *
         * @return
         */
        FindPathTypeOut all();

        /**
         * 最短路径
         *
         * @return
         */
        FindPathTypeOut shortest();

        /**
         * 不循环路径
         *
         * @return
         */
        FindPathTypeOut noloop();
    }

    interface FindPathTypeOut extends FindPathWithProp, FindPathFromTo {

    }

    interface FindPathWithProp {
        /**
         * 是否展示边属性
         *
         * @param withProp
         * @return
         */
        FindPathWithPropOut withProp(boolean withProp);
    }

    interface FindPathWithPropOut extends FindPathFromTo {

    }

    interface FindPathFromTo {
        /**
         * 检索起始点
         *
         * @param fromVids
         * @param toVids
         * @return
         */
        FindPathFromToOut fromTo(List<Object> fromVids, List<Object> toVids);
    }

    interface FindPathFromToOut extends FindPathOver, FindPathStep, FindPathLimit, FindPathYield, Build {
    }

    interface FindPathOver {
        /**
         * 检索边类型
         *
         * @param in
         * @param out
         * @param edgeType
         * @return
         */
        FindPathOverOut over(boolean in, boolean out, String... edgeType);
    }

    interface FindPathOverOut extends FindPathWhere, FindPathStep, FindPathLimit, FindPathYield, Build {
    }


    interface FindPathWhere {
        /**
         * 检索and条件
         *
         * @param key
         * @param operator
         * @param value
         * @return
         */
        FindPathWhereOut and(String key, String operator, Object value);

        /**
         * 检索or条件
         *
         * @param key
         * @param operator
         * @param value
         * @return
         */
        FindPathWhereOut or(String key, String operator, Object value);
    }

    interface FindPathWhereOut extends FindPathWhere, FindPathStep, Build {
    }

    interface FindPathStep {
        /**
         * 检索步长
         *
         * @param steps
         * @return
         */
        FindPathStepOut steps(int steps);
    }

    interface FindPathStepOut extends FindPathYield, FindPathLimit, Build {

    }

    interface FindPathYield {
        /**
         * 返回路径
         *
         * @param pathAlias
         * @return
         */
        FindPathYieldOut yield(String pathAlias);

    }

    interface FindPathYieldOut extends FindPathLimit, Build {

    }

    interface FindPathLimit {
        /**
         * 分页
         *
         * @param pageNo
         * @param pageSize
         * @return
         */
        FindPathLimitOut limit(int pageNo, int pageSize);
    }

    interface FindPathLimitOut extends Build {
    }

}
